﻿<!DOCTYPE HTML>
<html lang="zh">
<head>
<title>字符串长度 - 语法 &amp; 使用 | AutoHotkey v2</title>
<meta name="description" content="The 字符串长度 function retrieves the count of how many characters are in a 字符串." />
<meta name="ahk:equiv-v1" content="commands/StringLen.htm" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
<script type="text/javascript">$(function(){0<=window.navigator.userAgent.toLowerCase().indexOf("ucbrowser")&&CaoNiMaDeUc()})</script>
</head>
<body>

<h1>字符串长度</h1>

<p>检索字符串中的字符数.</p>

<pre class="Syntax">Length := <span class="func">字符串长度</span>(字符串)</pre>
<h2 id="Parameters">参数</h2>
<dl>

  <dt>字符串</dt>
  <dd>
    <p>类型: <a href="../Concepts.htm#strings">字符串</a></p>
    <p>要统计其内容的字符串.</p>
  </dd>

</dl>

<h2 id="Return_Value">返回值</h2>
<p>类型: <a href="../Concepts.htm#numbers">整数</a></p>
<p>函数返回指定字符串的长度.</p>

<h2 id="Related">相关</h2>
<p><a href="InStr.htm">查找</a>, <a href="SubStr.htm">截取字符串</a>, <a href="Trim.htm">修剪</a>, <a href="StrLower.htm">字符串小写</a>, <a href="StrLower.htm">字符串大写</a>, <a href="StrPut.htm">置字符串</a>, <a href="StrGet.htm">获取字符串</a>, <a href="StrReplace.htm">字符串替换</a>, <a href="StrSplit.htm">分割字符串</a></p>
<h2 id="Examples">示例</h2>
<div class="ex" id="ExBasic">
<p><a href="#ExBasic">#1</a></p>
<pre>InputVar := "The Quick Brown Fox Jumps Over the Lazy Dog"
信息框 &quot;The length of InputVar is &quot; 字符串长度(InputVar) <em>; 结果: 43</em></pre>
</div>

</body>
</html>